﻿@model IEnumerable<EventPlanner.Models.Contacto>

@{
    ViewBag.Title = "EnviarInvitaciones";
}

<h2 style="font-family: 'Segoe Print'">Enviar Invitaciones</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@if (Model.Count() == 0)
{
    <b> La lista de contactos esta vacía </b>
}
else
{


using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Editar Mail</legend>

        <br />

        @if (TempData["notice"] == null)        
        {        

        <table>
        <tr>        
            <th>
                Nombre
            </th>
            <th>
                Apellido
            </th>
            <th>
                Email
            </th>        
            <th>
                Seleccionar
            </th>        
            
        </tr>

    @foreach (var item in Model)
    {        
        <tr>        
            <td>
                @Html.DisplayFor(modelItem => item.Nombre)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Apellido)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Email)
            </td>    
            <td>
                <input type="checkbox" name="selcontactos" checked="checked" value="@item.Email" />                
            </td>                            
        </tr>              
    }
    </table>

    <br/>    


    <div class="editor-label">
        <label for="subject">Asunto</label>
    </div>
    <div class="editor-field">
        <input class="text-box single-line" id="subject" name="subject" type="text" value="@ViewBag.subject" />         
    </div>


    <div class="editor-label">
        <label for="subject">Cuerpo del mensaje</label>
    </div>
    <div class="editor-field">        
        <textarea id="body" name="body" cols="40" rows="5"> @ViewBag.body </textarea>
    </div>

    
        <p>
            <input type="submit" value="Enviar" />
        </p>
    }
    else                
    {
        <p>@TempData["notice"]</p>
    }

        
    </fieldset>
}
}



<div>
    @Html.ActionLink("Volver a Eventos", "Index")
</div>
